//##################################################
//           TEXTURE LOADING CODE                  #
//##################################################

#ifndef TEXTURING_H
#define TEXTURING_H 1

#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
//#include <gl\glaux.h>
#include <gl\glext.h>
#include <olectl.h>	
#include <math.h>

#define TEX_RESOURCE 0
#define TEX_RENDER   1
#define TEX_2D       2

class TEXTURE
{
public:
	void Init(GLint param1, GLint param2, bool s3tc);
	int  Generate(int mode, char *szPathName, int res_id, GLuint &texid);

	void SetViewport(int width, int heigth);
	void RenderTo(int viewport_x, int viewport_y, int screen_x, int screen_y, GLuint &texid);
/*
	void LoadCubeMap(char *name1, char *name2, char *name3, char *name4, char *name5, char *name6, GLuint &texid);
	void BindCubemap(GLuint &texture);*/
private:
	GLint  tex_param1;
	GLint  tex_param2;
	bool   tex_comp;

	int BuildTexture(char *szPathName, GLuint &texid);
	int CreateResTexture(int image, GLuint &texid);
	int CreateRenderTexture(int size, int channels, int type, GLuint &textureID);
};



#endif